<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title><?php echo $view_title?></title>
	<link rel=stylesheet href='./template/<?php echo $OJ_TEMPLATE?>/<?php echo isset($OJ_CSS)?$OJ_CSS:"hoj.css" ?>' type='text/css'>
</head>

<body>
	
<script type="text/javascript" src="include/wz_jsgraphics.js"></script>
<script language="javascript" type="text/javascript" src="include/jquery-latest.js"></script>
<script language="javascript" type="text/javascript" src="include/jquery.flot.js"></script>
<div>
<?php require_once("oj-header.php");?>
<div id=main>

<?php $sql="SELECT DISTINCT `problem_id` FROM `solution` WHERE `user_id`='$user' AND `result`=4 ORDER BY `problem_id` ASC";	
if (!($result=mysql_query($sql))) echo mysql_error();
?>

<div class="user-profile">
<div><h2><?php echo $user." - ".htmlspecialchars($nick);?></h2></div>


<div class="row basic-info">
        <div class="col-sm-7 user-card">
            <ul class="nav nav-pills nav-stacked">
                <li><a><i class="glyphicon glyphicon-home"></i> <?php echo $school?></a></li>
                                <li><a><i class="glyphicon glyphicon-envelope"></i> <?php echo $email?></a></li>
            </ul>
        </div>
        <div class="col-sm-5 user-stats">
            <ul class="nav nav-pills">
                <li class="accept" value="<?php echo $AC?>" id="通过"><?php echo $AC?></li>
				<li class="fail" value="<?php echo $Submit-$AC?>" id="失败"><?php echo $Submit-$AC?></li>
                <li class="submit" value="<?php echo $Submit?>" id="提交"><?php echo $Submit?></li>
            </ul>
            <script type="text/javascript">
                $('div.user-stats li').mouseenter(function (e) {
                    var ele = $(this);
                    ele.text(ele.attr('id'));
                }).mouseleave(function (e) {
                    var ele = $(this);
                    ele.text(ele.attr('value'));
                })
            </script>
        </div>	
</div>

<div class="problem-info">
    <div class="panel panel-success solved_problems">
        <div class="panel-heading">解决的问题</div>
        <div class="panel-body">
		    <?php 
			while ($row=mysql_fetch_array($result)){
			    echo "<a class='btn btn-success' href='/problem.php?id=".$row[0]."' style='font-size: 11px'>".$row[0]."</a>";
			}
			?>
            
        </div>
    </div>
</div>


<div id=foot>
	<?php require_once("oj-footer.php");?>

</div><!--end foot-->
</div><!--end main-->
</div><!--end wrapper-->
</body>
</html>
